

<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" data-content_root="../../">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>最佳实践 &mdash; Seatools 1.0.0 文档</title>
      <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
      <link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />

  
      <script src="../../_static/jquery.js?v=5d32c60e"></script>
      <script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
      <script src="../../_static/documentation_options.js?v=34088549"></script>
      <script src="../../_static/doctools.js?v=9bcbadda"></script>
      <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
      <script src="../../_static/translations.js?v=beaddf03"></script>
    <script src="../../_static/js/theme.js"></script>
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="Web FastAPI" href="../seatools-starter-web-fastapi/index.html" />
    <link rel="prev" title="配置指南" href="configuration.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #2980B9" >

          
          
          <a href="../../index.html" class="icon icon-home">
            Seatools
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="搜索文档" aria-label="搜索文档" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="导航菜单">
              <p class="caption" role="heading"><span class="caption-text">核心项目</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../seatools/index.html">Seatools</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#id1">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#id2">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#id3">核心功能</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#ioc">IOC 容器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#id4">工具包</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/index.html#id5">文件处理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/index.html#id6">数据模型</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/index.html#id7">加密工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/index.html#id8">通知服务</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/index.html#seatools-database">数据库支持</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/index.html#id10">其他工具</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#id11">版本要求</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#id12">联系方式</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#id13">相关项目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../seatools/index.html#id14">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/best_practices.html">最佳实践指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/best_practices.html#id2">项目结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/best_practices.html#ioc">IOC 最佳实践</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/best_practices.html#id4">数据库最佳实践</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/best_practices.html#id6">配置管理最佳实践</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/best_practices.html#id9">日志最佳实践</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/best_practices.html#id12">安全最佳实践</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/best_practices.html#id15">性能优化建议</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/builders.html">构建器工具</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/builders.html#html">HTML构建器</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/builders.html#id2">飞书消息构建器</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/cache.html">缓存支持</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/cache.html#id2">内存缓存</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/cache.html#id3">分布式缓存</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/database.html">数据库支持</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/database.html#sqlalchemy">SQLAlchemy 工具包</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/database.html#redis-om">Redis-OM 扩展</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/database.html#clickhouse">Clickhouse 支持</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/env.html">环境管理</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/env.html#id2">多环境配置</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/files.html">文件处理工具</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/files.html#id2">数据文件加载器</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/files.html#id3">数据文件导出器</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/ioc.html">IOC 容器详解</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/ioc.html#bean">Bean 管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/ioc.html#id1">依赖注入</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/ioc.html#id2">配置管理</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/models.html">数据模型</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/models.html#id2">基础模型</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/models.html#id3">配置模型</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/models.html#id4">通用响应</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/models.html#id5">分页模型</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/notices.html">通知服务</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/notices.html#id2">邮件通知</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/notices.html#id3">飞书机器人</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/retry.html">重试机制</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/retry.html#id2">同步重试</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/retry.html#id3">异步重试</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../seatools/utils.html">实用工具</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/utils.html#id2">加密工具</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/utils.html#id3">重试机制</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/utils.html#id4">缓存工具</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../seatools/utils.html#id5">日志工具</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">项目模板</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../cookiecutter-seatools-python/index.html">Cookiecutter Seatools Python 模板</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../cookiecutter-seatools-python/index.html#id1">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cookiecutter-seatools-python/index.html#id2">使用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cookiecutter-seatools-python/index.html#id3">项目结构</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cookiecutter-seatools-python/index.html#id4">文件说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cookiecutter-seatools-python/index.html#id5">核心功能</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cookiecutter-seatools-python/index.html#id6">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cookiecutter-seatools-python/index.html#id7">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../cookiecutter-seatools-python/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/usage.html#id2">生成项目</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/usage.html#id3">配置项目</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/usage.html#id4">运行项目</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../cookiecutter-seatools-python/structure.html">项目结构</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/structure.html#id2">文件说明</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/structure.html#id3">主要目录说明</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/structure.html#id4">示例代码</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../cookiecutter-seatools-python/best_practices.html">最佳实践指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/best_practices.html#id2">项目结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/best_practices.html#id3">配置管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../cookiecutter-seatools-python/best_practices.html#id4">测试</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">启动器</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../seatools-starter-sqlalchemy/index.html">数据库</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-sqlalchemy/index.html#id2">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-sqlalchemy/index.html#id3">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-sqlalchemy/index.html#id4">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-sqlalchemy/index.html#id5">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-sqlalchemy/index.html#id6">使用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-sqlalchemy/index.html#id7">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-sqlalchemy/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/usage.html#id2">快速开始</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/usage.html#id3">异步支持</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-sqlalchemy/configuration.html">配置指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/configuration.html#id2">数据库配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/configuration.html#id3">配置项说明</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/configuration.html#id4">高级配置</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-sqlalchemy/best_practices.html">最佳实践</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/best_practices.html#id2">会话管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/best_practices.html#id3">数据库操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/best_practices.html#id4">性能优化</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/best_practices.html#id5">安全建议</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-sqlalchemy/best_practices.html#id6">异步操作建议</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../seatools-starter-cache/index.html">缓存</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-cache/index.html#id2">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-cache/index.html#id3">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-cache/index.html#id4">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-cache/index.html#id5">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-cache/index.html#id6">使用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-cache/index.html#id7">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-cache/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-cache/usage.html#id2">快速开始</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-cache/usage.html#id3">缓存操作</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-cache/usage.html#id4">缓存装饰器</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-cache/usage.html#id5">装饰器说明</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-cache/configuration.html">配置指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-cache/configuration.html#id2">缓存配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-cache/configuration.html#id3">配置项说明</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-cache/best_practices.html">最佳实践</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-cache/best_practices.html#id2">缓存使用建议</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-cache/best_practices.html#id3">性能优化</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-cache/best_practices.html#id4">安全建议</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Redis</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="index.html#id1">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#id2">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#id3">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#id4">快速开始</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html#id5">更多文档</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="usage.html#id2">基础用法</a></li>
<li class="toctree-l4"><a class="reference internal" href="usage.html#id3">高级功能</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="configuration.html">配置指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="configuration.html#id2">基本配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="configuration.html#id3">配置项说明</a></li>
</ul>
</li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">最佳实践</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id2">性能优化</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">安全建议</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">故障处理</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../seatools-starter-web-fastapi/index.html">Web FastAPI</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-fastapi/index.html#id1">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-fastapi/index.html#id2">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-fastapi/index.html#id3">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-fastapi/index.html#id4">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-fastapi/index.html#id5">使用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-fastapi/index.html#id6">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-web-fastapi/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-fastapi/usage.html#id2">快速开始</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-web-fastapi/configuration.html">配置指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-fastapi/configuration.html#fastapi">FastAPI 配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-fastapi/configuration.html#id2">配置项说明</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-web-fastapi/best_practices.html">最佳实践</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-fastapi/best_practices.html#id2">性能优化</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-fastapi/best_practices.html#id3">安全建议</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-fastapi/best_practices.html#id4">日志管理</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../seatools-starter-web-flask/index.html">Web Flask</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-flask/index.html#id1">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-flask/index.html#id2">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-flask/index.html#id3">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-flask/index.html#id4">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-flask/index.html#id5">使用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-web-flask/index.html#id6">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-web-flask/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-flask/usage.html#id2">快速开始</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-web-flask/configuration.html">配置指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-flask/configuration.html#flask">Flask 配置</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-web-flask/best_practices.html">最佳实践</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-flask/best_practices.html#id2">性能优化</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-flask/best_practices.html#id3">安全建议</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-web-flask/best_practices.html#id4">日志管理</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../seatools-starter-server-gunicorn/index.html">服务器 Gunicorn</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-gunicorn/index.html#id1">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-gunicorn/index.html#id2">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-gunicorn/index.html#id3">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-gunicorn/index.html#id4">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-gunicorn/index.html#id5">使用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-gunicorn/index.html#id6">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-server-gunicorn/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-gunicorn/usage.html#id2">快速开始</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-server-gunicorn/configuration.html">配置指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-gunicorn/configuration.html#gunicorn">Gunicorn 配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-gunicorn/configuration.html#id2">配置项说明</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-server-gunicorn/best_practices.html">最佳实践</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-gunicorn/best_practices.html#id2">性能优化</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-gunicorn/best_practices.html#id3">安全建议</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-gunicorn/best_practices.html#id4">日志管理</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../seatools-starter-server-uvicorn/index.html">服务器 Uvicorn</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-uvicorn/index.html#id1">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-uvicorn/index.html#id2">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-uvicorn/index.html#id3">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-uvicorn/index.html#id4">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-uvicorn/index.html#id5">使用</a></li>
<li class="toctree-l2"><a class="reference internal" href="../seatools-starter-server-uvicorn/index.html#id6">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-server-uvicorn/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-uvicorn/usage.html#id2">快速开始</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-server-uvicorn/configuration.html">配置指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-uvicorn/configuration.html#uvicorn">Uvicorn 配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-uvicorn/configuration.html#id2">配置项说明</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../seatools-starter-server-uvicorn/best_practices.html">最佳实践</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-uvicorn/best_practices.html#id2">性能优化</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-uvicorn/best_practices.html#id3">安全建议</a></li>
<li class="toctree-l4"><a class="reference internal" href="../seatools-starter-server-uvicorn/best_practices.html#id4">日志管理</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">拓展工具</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../tools/seatools-codegen/index.html">代码生成器</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-codegen/index.html#id2">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-codegen/index.html#id3">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-codegen/index.html#id4">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-codegen/index.html#id5">快速开始</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-codegen/index.html#id6">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../tools/seatools-codegen/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/usage.html#id2">基础用法</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/usage.html#id3">高级功能</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../tools/seatools-codegen/configuration.html">配置指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/configuration.html#id2">全局配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/configuration.html#id3">生成规则</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/configuration.html#id4">项目配置</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../tools/seatools-codegen/best_practices.html">最佳实践</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/best_practices.html#id2">应用生成</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/best_practices.html#cmd">CMD 生成</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/best_practices.html#id3">任务生成</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-codegen/best_practices.html#id4">安全建议</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../tools/seatools-chrome/index.html">Chrome 工具</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-chrome/index.html#id1">项目地址</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-chrome/index.html#id2">主要特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-chrome/index.html#id3">安装</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-chrome/index.html#id4">快速开始</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tools/seatools-chrome/index.html#id5">更多文档</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../tools/seatools-chrome/usage.html">使用指南</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-chrome/usage.html#id2">基础用法</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../tools/seatools-chrome/usage.html#id3">高级功能</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="移动版导航菜单"  style="background: #2980B9" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">Seatools</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content style-external-links">
          <div role="navigation" aria-label="页面导航">
  <ul class="wy-breadcrumbs">
      <li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="index.html">Redis</a></li>
      <li class="breadcrumb-item active">最佳实践</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/seatools-py/seatools/blob/main/docs/source/starters/seatools-starter-redis/best_practices.rst" class="fa fa-github"> 在 GitHub 上编辑</a>
      </li>
  </ul><div class="rst-breadcrumbs-buttons" role="navigation" aria-label="顺序式页面导航">
        <a href="configuration.html" class="btn btn-neutral float-left" title="配置指南" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
        <a href="../seatools-starter-web-fastapi/index.html" class="btn btn-neutral float-right" title="Web FastAPI" accesskey="n">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
  </div>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="id1">
<h1>最佳实践<a class="headerlink" href="#id1" title="Link to this heading"></a></h1>
<section id="id2">
<h2>性能优化<a class="headerlink" href="#id2" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p>使用 pipeline 提升批量操作性能</p></li>
<li><p>对大数据使用分页扫描(SCAN)代替 KEYS</p></li>
<li><p>合理设置 decode_responses 参数</p></li>
</ul>
</section>
<section id="id3">
<h2>安全建议<a class="headerlink" href="#id3" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p>生产环境必须配置密码</p></li>
<li><p>限制 Redis 端口访问权限</p></li>
<li><p>定期轮换认证密码</p></li>
</ul>
</section>
<section id="id4">
<h2>故障处理<a class="headerlink" href="#id4" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p>监控 Redis 连接状态</p></li>
<li><p>设置合理的超时时间</p></li>
<li><p>使用健康检查接口监控状态</p></li>
</ul>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="页脚">
        <a href="configuration.html" class="btn btn-neutral float-left" title="配置指南" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
        <a href="../seatools-starter-web-fastapi/index.html" class="btn btn-neutral float-right" title="Web FastAPI" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; 版权所有 2024, Seatools Team。</p>
  </div>

  利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建，使用的 
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
    由 <a href="https://readthedocs.org">Read the Docs</a> 开发.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>